import axios from '@/utils/axios'

const addSubMerchantConfigApi = '/sp_admin/pay_config/addSubMerchant' // 新增进件
const channelConfigsByChannelTypeApi = '/sp_admin/pay_config/getSvrChannelConfsByChannelType' // 进件详情
const subMerchantConfigDetailApi = '/sp_admin/pay_config/subMerchantConfigInfo' // 进件详情
const subMerchantConfigListApi = '/sp_admin/pay_config/getSubMchRecords' // 进件列表
const bankNameListApi = '/sp_admin/pay_config/getABCDefineBankName' // 银行列表
// const uploadSubMerCertImgFileApi = '/sp_admin/pay_config/uploadSubMerFile' // 上传证件
const sendSubMerchantVerifyMessageApi = '/sp_admin/pay_config/subMerchantSendMessage' // 发送核销码
const subMerchantVerifyMessageApi = '/sp_admin/pay_config/subMerchantVerifyMessage' // 提交核销验证

/**
 * @desc 进件新增
 */
export const addSubMerchantConfig = ({ data }) => {
  return axios.post(addSubMerchantConfigApi, data)
}

/**
 * @desc 进件详情
 */
export const subMerchantConfigDetail = ({ params }) => {
  return axios({
    url: subMerchantConfigDetailApi,
    method: 'get',
    params: params
  })
}

/**
 * @desc 进件列表
 */
export const channelConfigsByChannelType = ({ data }) => {
  return axios.post(channelConfigsByChannelTypeApi, data)
}

/**
 * @desc 进件列表
 */
export const subMerchantConfigList = ({ data }) => {
  return axios.post(subMerchantConfigListApi, data)
}

/**
 * @desc 银行列表
 */
export const bankNameList = () => {
  return axios.get(bankNameListApi)
}

// /**
//  * @desc 上传证件
//  */
// export const uploadSubMerCertImgFile = ({ data }) => {
//   return axios.post(uploadSubMerCertImgFileApi, data)
// }

/**
 * @desc 发送验证码
 */
export const sendSubMerchantVerifyMessage = ({ data }) => {
  return axios.post(sendSubMerchantVerifyMessageApi, data)
}

/**
 * @desc 提交验证
 */
export const subMerchantVerifyMessage = ({ data }) => {
  return axios.post(subMerchantVerifyMessageApi, data)
}
